1、元素上下排列时,上下外边距会合并(上下外边距取最大值)
2、元素左右排列时,左右外边距会叠加(左右外边距会相加)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css</title>
<style type="text/css">
.laoLiu{
width:100px;height:100px;background:#E1EFFF;
margin-bottom: 30px ;
margin-left: 60px ;
}
.laoQi{
width:100px;height:100px;background:#E1EFFF;
margin-top:30px;
}
</style>
</head>
<body>
<div style="background:gray;height:10px;"></div>
<div class="laoLiu"></div>
<div class="laoQi"></div>
<div style="background:purple;height:10px;"></div>
</body>
</html>
返回: